using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Core_HGUI_HVertex_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Core.HGUI.HVertex);

            field = type.GetField("position", flag);
            app.RegisterCLRFieldGetter(field, get_position_0);
            app.RegisterCLRFieldSetter(field, set_position_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_position_0, AssignFromStack_position_0);
            field = type.GetField("normal", flag);
            app.RegisterCLRFieldGetter(field, get_normal_1);
            app.RegisterCLRFieldSetter(field, set_normal_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_normal_1, AssignFromStack_normal_1);
            field = type.GetField("color", flag);
            app.RegisterCLRFieldGetter(field, get_color_2);
            app.RegisterCLRFieldSetter(field, set_color_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_color_2, AssignFromStack_color_2);
            field = type.GetField("uv", flag);
            app.RegisterCLRFieldGetter(field, get_uv_3);
            app.RegisterCLRFieldSetter(field, set_uv_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_uv_3, AssignFromStack_uv_3);
            field = type.GetField("uv1", flag);
            app.RegisterCLRFieldGetter(field, get_uv1_4);
            app.RegisterCLRFieldSetter(field, set_uv1_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_uv1_4, AssignFromStack_uv1_4);
            field = type.GetField("uv2", flag);
            app.RegisterCLRFieldGetter(field, get_uv2_5);
            app.RegisterCLRFieldSetter(field, set_uv2_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_uv2_5, AssignFromStack_uv2_5);
            field = type.GetField("uv3", flag);
            app.RegisterCLRFieldGetter(field, get_uv3_6);
            app.RegisterCLRFieldSetter(field, set_uv3_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_uv3_6, AssignFromStack_uv3_6);
            field = type.GetField("uv4", flag);
            app.RegisterCLRFieldGetter(field, get_uv4_7);
            app.RegisterCLRFieldSetter(field, set_uv4_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_uv4_7, AssignFromStack_uv4_7);
            field = type.GetField("picture", flag);
            app.RegisterCLRFieldGetter(field, get_picture_8);
            app.RegisterCLRFieldSetter(field, set_picture_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_picture_8, AssignFromStack_picture_8);
            field = type.GetField("fillColor", flag);
            app.RegisterCLRFieldGetter(field, get_fillColor_9);
            app.RegisterCLRFieldSetter(field, set_fillColor_9);
            app.RegisterCLRFieldBinding(field, CopyToStack_fillColor_9, AssignFromStack_fillColor_9);

            app.RegisterCLRMemberwiseClone(type, PerformMemberwiseClone);

            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Core.HGUI.HVertex());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Core.HGUI.HVertex[s]);


        }

        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref huqiang.Core.HGUI.HVertex instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch(ptr_of_this_method->ObjectType)
            {
                case ObjectTypes.Object:
                    {
                        __mStack[ptr_of_this_method->Value] = instance_of_this_method;
                    }
                    break;
                case ObjectTypes.FieldReference:
                    {
                        var ___obj = __mStack[ptr_of_this_method->Value];
                        if(___obj is ILTypeInstance)
                        {
                            ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            var t = __domain.GetType(___obj.GetType()) as CLRType;
                            t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                        }
                    }
                    break;
                case ObjectTypes.StaticFieldReference:
                    {
                        var t = __domain.GetType(ptr_of_this_method->Value);
                        if(t is ILType)
                        {
                            ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                        }
                    }
                    break;
                 case ObjectTypes.ArrayReference:
                    {
                        var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as huqiang.Core.HGUI.HVertex[];
                        instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
                    }
                    break;
            }
        }


        static object get_position_0(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).position;
        }

        static StackObject* CopyToStack_position_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).position;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_position_0(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.position = (UnityEngine.Vector3)v;
            o = ins;
        }

        static StackObject* AssignFromStack_position_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector3 @position = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.position = @position;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_normal_1(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).normal;
        }

        static StackObject* CopyToStack_normal_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).normal;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_normal_1(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.normal = (UnityEngine.Vector3)v;
            o = ins;
        }

        static StackObject* AssignFromStack_normal_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector3 @normal = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.normal = @normal;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_color_2(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).color;
        }

        static StackObject* CopyToStack_color_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).color;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_color_2(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.color = (UnityEngine.Color32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_color_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Color32 @color = (UnityEngine.Color32)typeof(UnityEngine.Color32).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.color = @color;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_uv_3(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).uv;
        }

        static StackObject* CopyToStack_uv_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).uv;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_uv_3(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv = (UnityEngine.Vector2)v;
            o = ins;
        }

        static StackObject* AssignFromStack_uv_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2 @uv = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv = @uv;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_uv1_4(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).uv1;
        }

        static StackObject* CopyToStack_uv1_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).uv1;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_uv1_4(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv1 = (UnityEngine.Vector2)v;
            o = ins;
        }

        static StackObject* AssignFromStack_uv1_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2 @uv1 = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv1 = @uv1;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_uv2_5(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).uv2;
        }

        static StackObject* CopyToStack_uv2_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).uv2;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_uv2_5(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv2 = (UnityEngine.Vector2)v;
            o = ins;
        }

        static StackObject* AssignFromStack_uv2_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2 @uv2 = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv2 = @uv2;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_uv3_6(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).uv3;
        }

        static StackObject* CopyToStack_uv3_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).uv3;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_uv3_6(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv3 = (UnityEngine.Vector2)v;
            o = ins;
        }

        static StackObject* AssignFromStack_uv3_6(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2 @uv3 = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv3 = @uv3;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_uv4_7(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).uv4;
        }

        static StackObject* CopyToStack_uv4_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).uv4;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_uv4_7(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv4 = (UnityEngine.Vector2)v;
            o = ins;
        }

        static StackObject* AssignFromStack_uv4_7(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2 @uv4 = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.uv4 = @uv4;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_picture_8(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).picture;
        }

        static StackObject* CopyToStack_picture_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).picture;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_picture_8(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.picture = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_picture_8(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @picture = ptr_of_this_method->Value;
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.picture = @picture;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_fillColor_9(ref object o)
        {
            return ((huqiang.Core.HGUI.HVertex)o).fillColor;
        }

        static StackObject* CopyToStack_fillColor_9(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HVertex)o).fillColor;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_fillColor_9(ref object o, object v)
        {
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.fillColor = (System.Single)v;
            o = ins;
        }

        static StackObject* AssignFromStack_fillColor_9(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @fillColor = *(float*)&ptr_of_this_method->Value;
            huqiang.Core.HGUI.HVertex ins =(huqiang.Core.HGUI.HVertex)o;
            ins.fillColor = @fillColor;
            o = ins;
            return ptr_of_this_method;
        }


        static object PerformMemberwiseClone(ref object o)
        {
            var ins = new huqiang.Core.HGUI.HVertex();
            ins = (huqiang.Core.HGUI.HVertex)o;
            return ins;
        }


    }
}
